const query = require('../db')
async function login(username, password) {
  try {
    const sql = 'SELECT * FROM users WHERE userName = ? AND password = ?'
    const results = await query(sql, [username, password])
    return results
  } catch (error) {
    throw new Error('查询失败' + error.message)
  }
}
module.exports = login